package item;

import loadsave.Memento;
import loadsave.loadsaveobject.LoadSaveObject;

public abstract class TakeableItem extends Item implements Usable {
    
	public TakeableItem() { }
	
    public TakeableItem( String name ) {
        super(name);
    }
    
    /**
     * have the visitor visit this item to pick it up
     */
    public abstract void accept( visitors.TakeableItemVisitor tiv );
    
    /**
     * have the visitor visit this item
     */
    public void accept( visitors.ItemVisitor iv ) {
        iv.visitTakeableItem(this);
    }
    
    @Override
    public Memento getMemento() {
        return new Memento() {

			@Override
			public LoadSaveObject getState() {
				LoadSaveObject toReturn = TakeableItem.super.getMemento().getState();
				toReturn.setType("TakeableItem");
				return toReturn;
			}

			@Override
			public void restoreState(LoadSaveObject lso) {
				TakeableItem.super.getMemento().restoreState(lso);
			}
        	
        };
    }

}
